<template>
  <div class="sum" style="width: 100%;height: 100%;overflow-x:hidden;overflow-y:hidden">
  <a-row class="row_1" style="width: 98%;height:50% ">
    <div class="top">
      <div class="title1">输入参数</div>
      <p style="font-size: 15px;left: 12%;position: absolute">小轮</p>
      <p style="font-size: 15px;left: 19%;position: absolute">大轮</p>
      <div class="top_1" style="height: 100%">
        <div style="text-align: right;margin-right: 25px;">
          <ul  style="height: 100%;width: 100%">
            <li>大端端面模数(mm)</li>
            <li style="margin-top: 1px">齿数</li>
            <li style="margin-top: 1px">法向压力角(°)</li>
            <li style="margin-top: 1px">螺旋角(°)</li>
            <li style="margin-top: 1px">轴夹角(°)</li>
            <li style="margin-top: 1px">齿宽(mm)</li>
            <li style="margin-top: 1px">刀头圆角半径(mm)</li>
            <li style="margin-top: 1px">材料疲劳极限(MPa)</li>
          </ul>
        </div>

        <div style="height: 100%;width: 70%">
          <ul style="height: 100%;width: 50%">
            <li><input v-model="from.met" type="text" style="width: 83.5%"/></li>
            <li class="input_1"><input v-model="from.n" type="text" style="width: 40%;right: 0"/></li>
            <li ><input v-model="from.N" type="text" style="width: 35%;right: 0"/></li>
            <li ><input v-model="from.alaph" type="text" style="width: 83.5%"/></li>
            <li ><input v-model="from.phi"  type="text" style="width: 83.5%"/></li>
            <li ><input v-model="from.sigma" type="text" style="width: 83.5%"/></li>
            <li ><input v-model="from.F" type="text" style="width: 83.5%"/></li>
            <li class="input_1"><input type="text" v-model="from.rao1" style="width: 40%"/></li>
            <li ><input v-model="from.rao2" type="text" style="width: 35%;right: 0"/></li>
            <li class="input_1"><input v-model="from.sigmaF_limit1" type="text" style="width: 40%;right: 0"/></li>
            <li ><input v-model="from.sigmaF_limit2" type="text" style="width: 35%;right: 0"/></li>
          </ul>
        </div>
      </div>
      <div class="top_2">
        <div style="text-align: right;margin-right: 25px;">
          <ul style="height: 100%;width: 100%">
            <li>锥齿轮类型</li>
            <li v-show="from.bevel_gear_type==1" style="margin-top: 3px">小齿轮工作齿面</li>
            <li style="margin-top: 3px">齿轮精度等级</li>
            <li style="margin-top: 3px">齿制</li>
            <li v-show="from.whether_gleason==1" style="margin-top: 3px">大端齿顶高系数</li>
            <li v-show="from.whether_gleason==1" style="margin-top: 3px">顶隙系数</li>
          </ul>
        </div>

        <div>
          <ul>
            <li>
              <select v-model="from.bevel_gear_type" style="height: 25px;border-radius: 2px;width: 70%;">
                <option value="1">直齿或零度弧齿锥齿轮</option>
                <option value="2">螺旋锥齿轮</option>
              </select>
            </li>
            <li>
              <select v-show="from.bevel_gear_type==1" v-model="from.pinion_work_flank" style="height: 25px;border-radius: 2px;width: 70%;">
                <option value="1">凹面</option>
                <option value="2">凸面</option>
              </select>
            </li>
            <li>
              <select v-model="from.quality_number" style="height: 25px;border-radius: 2px;width: 70%;">
                <option value="1">7</option>
                <option value="2">5</option>
                <option value="3">6</option>
                <option value="4">7</option>
                <option value="5">8</option>
                <option value="6">9</option>
                <option value="7">10</option>
                <option value="8">11</option>
              </select>
            </li>
            <li>
              <select v-model="from.whether_gleason" style="height: 25px;border-radius: 2px;width: 70%;">
                <option value="1">gleason</option>
                <option value="2">AGMA</option>
              </select>
            </li>
            <li><input v-show="from.whether_gleason==1" v-model="from.ha_s" type="text" style="width: 83.5%"/></li>
            <li><input v-show="from.whether_gleason==1" v-model="from.cc_s" type="text" style="width: 83.5%"/></li>
          </ul>
        </div>
      </div>
      <div class="top_3">
        <div style="text-align: right;margin-right: 25px;">
          <ul style="height: 100%;width: 100%">
            <li>差数器行星架最大输入扭矩(Nmm)</li>
            <li style="margin-top: 3px">行星轮个数</li>
            <li style="margin-top: 3px">均载降级系数</li>
            <li style="margin-top: 3px">是否用gleason材料</li>
            <li style="margin-top: 3px">是否考虑侧隙影响</li>
            <li v-show="from.backlash_effect==1" style="margin-top: 3px">小轮侧隙分配比例</li>
          </ul>
        </div>

        <div>
          <ul>
            <li><input v-model="from.T_max" type="text" style="width: 83.5%"/></li>
            <li><input v-model="from.n_planet" type="text" style="width: 83.5%"/></li>
            <li><input v-model="from.kn" type="text" style="width: 83.5%"/></li>
            <li>
              <select v-model="from.whether_gleason_material" style="height: 25px;border-radius: 2px;width: 70%;">
                <option value="1">是</option>
                <option value="2">否</option>
              </select>
            </li>
            <li>
              <select v-model="from.backlash_effect" style="height: 25px;border-radius: 2px;width: 70%;">
                <option value="0">是</option>
                <option value="1">否</option>
              </select>
            </li>
            <li><input v-show="from.backlash_effect==1" v-model="from.f_b_s" type="text" style="width: 83.5%"/></li>
          </ul>
        </div>
      </div>
      <div >
        <button style="margin-top: 13%;margin-left: 80%;" @click="geta">计算</button>
      </div>

    </div>
  </a-row>
  <a-row class="row_2" style="width: 98%;height: 45%">
   <div class="down">
     <div class="title2">输出参数</div>
     <div class="down_1">
       <div style="text-align: right;margin-right: 20px">
         <ul style="height: 100%;width: 100%">
           <li>小轮变位高系数</li>
           <li>中点工作齿高系数</li>
           <li>中点大轮齿高比例系数</li>
           <li>切向变位系数</li>
           <li>小齿轮弯曲几何系数</li>
           <li>大齿轮弯曲几何系数</li>
           <li>齿向载荷分布系数</li>
         </ul>
       </div>

       <div>
         <ul style="text-align: center">
           <li>{{ans.a}}</li>
           <li>{{ans.b}}</li>
           <li>{{ans.c}}</li>
           <li>{{ans.d}}</li>
           <li>{{ans.e}}</li>
           <li>{{ans.f}}</li>
           <li>{{ans.g}}</li>
         </ul>
       </div>
   </div>
     <div class="down_2">
       <div style="text-align: right;margin-right: 20px">
         <ul style="height: 100%;width: 100%">
           <li>小轮计算弯曲应力(MPa)</li>
           <li>大轮计算弯曲应力(MPa)</li>
           <li>小轮许用弯曲应力(MPa)</li>
           <li>大轮许用弯曲应力(MPa)</li>
           <li>小轮静强度安全系数</li>
           <li>大轮静强度安全系数</li>
           <li>尺寸系数</li>
         </ul>
       </div>

       <div>
         <ul style="text-align: center">
           <li>{{ans.a1}}</li>
           <li>{{ans.b1}}</li>
           <li>{{ans.c1}}</li>
           <li>{{ans.d1}}</li>
           <li>{{ans.e1}}</li>
           <li>{{ans.f1}}</li>
           <li>{{ans.g1}}</li>
         </ul>
       </div>
     </div>
     <div class="down_3">
       <div style="text-align: right;margin-right: 20px">
         <ul style="height: 100%;width: 100%">
           <li>小轮切向力(N)</li>
           <li>小轮径向力(N)</li>
           <li>小轮轴向力(N)</li>
           <li>大轮切向力(N)</li>
           <li>大轮径向力(N)</li>
           <li>大轮轴向力(N)</li>
         </ul>
       </div>

       <div>
         <ul style="text-align: center">
           <li>{{ans.a2}}</li>
           <li>{{ans.b2}}</li>
           <li>{{ans.c2}}</li>
           <li>{{ans.d2}}</li>
           <li>{{ans.e2}}</li>
           <li>{{ans.f2}}</li>
         </ul>
       </div>
     </div>
   </div>
  </a-row>

  </div>
</template>

<script>


import {module_bevel_gear_strength_static} from "@/api/file";


export default {
  created() {
    document.title='差速器锥齿轮静强度校核'
  },
  name:"zhuichilun",
  data(){
    return{
      from:{
        n:9,//小轮齿数
        N:14,//大轮齿数
        met:6.27,//大端断面模数
        sigma:90,//轴夹角
        alaph:25,//压力角
        phi:0,//螺旋角
        F:20,//齿宽
        rao1:0.6,//小轮刀头圆角半径
        rao2:0.6,//大轮刀头圆角半径
        bevel_gear_type:1,//锥齿轮类型
        quality_number:7,//精度等级
        whether_gleason:1,//齿制
        T_max:3166410,//差速器最大输入扭矩
        n_planet:2,//行星轮个数
        kn:1,//均载降级系数
        sigmaF_limit1:206.8,//小齿轮材料疲劳极限
        sigmaF_limit2:206.8,//大齿轮材料疲劳极限
        whether_gleason_material:1,//是否用gleason材料
        backlash_effect:0,//是否考虑侧隙影响
        pinion_work_flank:1,//小齿轮工作齿面
        f_b_s:0.5,//小轮侧隙分配比例
        ha_s:0.8,//大端齿顶高系数
        cc_s:0.1888,//顶隙系数
      },
      ans:{
        a:"Text",
        b:"Text",
        c:"Text",
        d:"Text",
        e:"Text",
        f:"Text",
        g:"Text",
        a1:"Text",
        b1:"Text",
        c1:"Text",
        d1:"Text",
        e1:"Text",
        f1:"Text",
        g1:"Text",
        a2:"Text",
        b2:"Text",
        c2:"Text",
        d2:"Text",
        e2:"Text",
        f2:"Text",
      }
    };
  },
  methods:{
    geta(){
      module_bevel_gear_strength_static(this.from)
          .then(res =>{
            console.log(res);
            this.ans.a=res[0];
            this.ans.b=res[1];
            this.ans.c=res[2];
            this.ans.d=res[3];
            this.ans.e=res[4];
            this.ans.f=res[5];
            this.ans.g=res[6];
            this.ans.a1=res[7];
            this.ans.b1=res[8];
            this.ans.c1=res[9];
            this.ans.d1=res[10];
            this.ans.e1=res[11];
            this.ans.f1=res[12];
            this.ans.g1=res[13];
            this.ans.a2=res[14];
            this.ans.b2=res[15];
            this.ans.c2=res[16];
            this.ans.d2=res[17];
            this.ans.e2=res[18];
            this.ans.f2=res[19];

            /*         if(res.code===200){*/
            /*             console.log(res.data);*/
            //this.ans=res.data;
            console.log(res)
            /*           }*/
          })
          .catch(error =>{
            console.log(error);
          });
    },

  }
}
</script>

<style scoped>
.top{
  width: 100%;
  height: 98%;
  position: relative;
  margin-bottom: 8px;
  margin-left: 8px;
  margin-right: 8px;
  box-shadow: 1.5px 1.5px 2px #aaaaaa;
  border-radius: 3px;
  border: 0.5px solid rgba(231,231,231,0.486);
}
.down{
  width: 100%;
  height: 100%;
  position: relative;
  margin-left: 8px;
  margin-right: 8px;
  box-shadow: 1.5px 1.5px 2px #aaaaaa;
  border-radius: 3px;
  border: 0.5px solid rgba(231,231,231,0.486);
}
.title1{
  width: 100%;
  height: 10%;
  background-color: #D7D7D7;
  font-size: 17.5px;
  border-radius: 5px;
  margin-top: 15px;
}
.title2{
  width: 100%;
  height: 12%;
  background-color: #D7D7D7;
  font-size: 17.5px;
  border-radius: 5px;
}
.input_1{
  position: absolute;
  left: 40%;
}
.top_1{
  display: flex;
  margin-left:3%;
  margin-top: 20px;
  width: 38%;
  position: absolute;
  left: 0;
}
.top_2{
  display: flex;
  margin-left:3%;
  margin-top: 20px;
  width: 30%;
  position: absolute;
  left: 30%;
}
.top_3{
  display: flex;
  margin-left:3%;
  margin-top: 20px;
  width: 35%;
  position: absolute;
  left: 57%;
}
.down_1{
  display: flex;
  margin-top: 12px;
  height: 100%;
  position: absolute;
  left: 0;
  width: 35%;
  margin-left: 7%;
}
.down_2{
  display: flex;
  margin-top: 12px;
  height: 100%;
  position: absolute;
  left: 30%;
  width: 35%;
  margin-left: 7%;
}
.down_3{
  display: flex;
  margin-top: 12px;
  height: 100%;
  position: absolute;
  left: 60%;
  width: 35%;
  margin-left: 7%;
}

.left_text li
{
  width: 100%;
  height: 10%;
}
</style>